<template>
	<view class="Manager_back">
		<view class="w90 f b c bb bg-fff p10 br5" v-for="(item,index) in lists" :key="index">
			<view class="wd70 f ">
				<view>
					<image style="width: 148rpx;height: 148rpx;" :src="item.img" mode=""></image>
				</view>
				<view class="f d ml15">
					<text class="fs28">{{item.name}}</text>
					<!-- <text class="fs22 hui mt10">擅长：蛙泳、自由泳</text> -->
				</view>
			</view>
			<view>
				<u-radio-group size="40" v-model="value" @change="radioGroupChange">
					<u-radio  :name="item.name" ></u-radio>
				</u-radio-group>
			</view>
		</view>
		<view class="Manager_but btn-submit-box">
			<button type="default" @click="sub_but">确定</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lists: [],
				value: '',
				id:'',
				day:'',
				timestr_id:'',
				
			}
		},
		onLoad(option) {
			this.value = option.name
			this.id = option.id
			this.day = option.day
			this.timestr_id = option.timestr_id
			this.init()
		},
		methods: {
			init(){
				var that = this
				var json = {
					id: that.id,
					date: that.day,
					timestr_id: that.timestr_id
				}
				that.$http.post(that.$config.UrlPostgetCoach, json).then((res) => {
					if (res.status == 1) {
						that.lists = res.data
					}
				})
			},
			sub_but(){
				if(this.value){
					var json ={
						name: this.value
					}
					uni.$emit('updateData', json)
					this.$api.back()
				}else{
					this.$api.toast('请选择教练')
				}
				
			},
			// 选中任一radio时，由radio-group触发
			radioGroupChange(e) {
				this.value = e
			},
		}
	}
</script>

<style scoped>
	
	.Manager_back {
		width: 100vw;
	}

	.Manager_but {
		margin: 0 auto;
		margin-top: 600rpx;
	}

	.Manager_but>button {
		width: 686rpx;
		height: 90rpx;
		background: #1f73f2;
		border-radius: 8rpx;
		color: #ffffff;
		font-size: 32rpx;
	}
</style>
